import abc
from datetime import datetime
class Customer:
    def __init__(self, name, contact, delivery_address,active: bool = True):
        self.name = name
        self.contact = contact
        self.delivery_address = delivery_address
        self.active = active


class Product:
    def __init__(self,title,weight,description,price):
        self.title = title
        self.weight = weight
        self.description = description
        self.price=price


    def get_price_for_quantity(self,quantity):
        return self.price*quantity

    def get_weight(self):
        return self.weight


class Order:
    def __init__(self, customer: Customer):
        self.create_date = datetime.now()
        self.status = "CREATE"
        self.customer = customer


class OrderDetail:
    def __init__(self,product:Product,quantity):
        self.product = product
        self.quantity = quantity

    def calculate_sub_total(self):
        return self.product.get_price_for_quantity(self.quantity)

    def calculate_weight(self):
        return self.product.get_weight() * self.quantity


class Payment(abc.ABC):
    def __init__(self, amount: float):
        self.amount = amount


class Credit(Payment):
    def __init__(self,amount:float,number,type,expire_date):
        super().__init__(amount)
        self.number = number
        self.type = type
        self.expire_date = expire_date


class Cash(Payment):
    def __init__(self, amount: float, cash_tendered: float):
        super().__init__(amount)
        self.cash_tendered = cash_tendered


class WireTransfer(Payment):
    def __init__(self, amount:float,bank_id,bank_name):
        super().__init__(amount)
        self.bank_id = bank_id
        self.bank_name = bank_name


class AliPay(Payment):
    def __init__(self, amount:float,number):
        super().__init__(amount)
        self.number = number


class WeixinPay(Payment):
    def __init__(self, amount:float,number):
        super().__init__(amount)
        self.number = number
